/**
 * ...
 * @author Krzysztof Rozalski
 */

package test;
import hapi.unit.HapiTestCase;
using hapi.physics.PhysicsFactoryMethods;

class TestMass extends HapiTestCase {

	public function testConstructor() {
		var tenKilos = 10.kilos();
		var twoTons = 2.tons();
		var fiveGrams = 5.grams();
		assertEquals(10.0, tenKilos.kilos);
		assertEquals(2.0, twoTons.tons);
		assertEquals(5.0, fiveGrams.grams);
	}
	
	public function testConversion() {
		var m = 678.5.kilos();
		assertEquals(678500.0, m.grams);
		assertEquals(0.6785, m.tons);
		
		m = 809123.grams();
		assertEquals(809.123, m.kilos);
		assertEquals(0.809123, m.tons);
	}
}